STEP 7: Let's set up Tim the Wizard's first response.

  • Change the string in .say() to "Definitely!".
  • Test your if-statement by clicking Run and asking Tim a question!
  • If rand_answer equals 1, Tim should say "Definitely!". If rand_answer isn't 1, then he'll say nothing.
  • Run the program several times until rand_answer equals 1 and Tim says “Definitely!”.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)